# 定义一个字典
my_dict = {"David Tao":100000000,"王力鸿":99,"周杰轮":88,"林俊节":80}
# 定义空字典
dict_empty1 = {}
dict_empty2 = dict()
print(f"字典1的内容是：{my_dict},类型是{type(my_dict)}")

# 字典基于key值获取value值
my_dict = {"David Tao":100000000,"王力鸿":99,"周杰轮":88,"林俊节":80}
score = my_dict["David Tao"]
print(f"David Tao的考试分数是：{score}")

# 定义嵌套字典
stu_score_dict = {
    "David Tao":{
        "语文":100,
        "数学":100,
        "英语":100
    },
    "王力鸿":{
        "语文":80,
        "数学":88,
        "英语":78
    },
    "周杰轮":{
        "语文":88,
        "数学":78,
        "英语":87
    },
    "林俊节":{
        "语文":89,
        "数学":78,
        "英语":84}
    }
print(stu_score_dict)

# 取出嵌套列表对应的值
score = stu_score_dict["David Tao"]["语文"]
print(f"David Tao的语文成绩是{score}分")